di "run `run' - updating and saving MU terms"
qui {

	local macrovars LSW HSW GDPGAP GDPPC VAEMP LSW_foreign HSW_foreign GDPGAP_foreign GDPPC_foreign VAEMP_foreign

	keep if year >= 1995 & year <= 2009
	keep BvD year `macrovars'
	gen run = `run'
	if `run' > 1 { 
		*get weighted average across runs
		gen weight = 1/`run'
		append using ${monte_data_dir}/storage_mu_`pvers'_`rname'.dta
		replace weight = (`run'-1)/(`run') if run != `run'
		collapse (mean)	`macrovars' [aw = weight], by(BvD year) 
		*rename for clarity in the alst run
		if `run' == `monte_runs' {
			foreach macrovar of local macrovars {
				rename `macrovar' `macrovar'_mu
			}
			* as indicator for the final dataset
			gen nr_runs = `run' 
		}
	}
	
	save ${monte_data_dir}/storage_mu_`pvers'_`rname'.dta, replace
}